import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_projectname_getx/page/test/test_view.dart';
import 'package:get/get.dart';

import 'app.dart';
import 'page/home/my_home_view.dart';
import 'theme.dart';
import 'utils/logger_util.dart';

void main() {
  runApp(MyApp());
  App.init();
}

class MyApp extends StatelessWidget {

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    final botToastBuilder = BotToastInit();
    return GetMaterialApp(
      title: 'Flutter Demo',
      theme: AppTheme.theme(),
      debugShowCheckedModeBanner: false,
      home: TestPage(),
      builder: (context, child) { //do something
        child = botToastBuilder(context,child);
        return child;
      },
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      // 配置多语言列表
      supportedLocales: [Locale("zh"),Locale("en")],
      localeListResolutionCallback: (locales, supportedLocales) {
        logger('$locales',name: "当前系统语言环境");
        return;
      },
    );
  }
}

